/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.railway.classes;

import java.util.Objects;

/**
 *
 * @author Kenny
 */
public class Train {

    private Integer trainId;
    private String trainName;

    public Train() {
    }

    public Train(Integer trainId, String trainName) {
        this.trainId = trainId;
        this.trainName = trainName;
    }

    public Integer getTrainId() {
        return trainId;
    }

    public void setTrainId(Integer trainId) {
        this.trainId = trainId;
    }

    public String getTrainName() {
        return trainName;
    }

    public void setTrainName(String trainName) {
        this.trainName = trainName;
    }

    @Override
    public String toString() {
        return trainName;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 31 * hash + Objects.hashCode(this.trainId);
        hash = 31 * hash + Objects.hashCode(this.trainName);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Train other = (Train) obj;
        if (!Objects.equals(this.trainId, other.trainId)) {
            return false;
        }
        return true;
    }
}
